package com.qj.daibei.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.qj.daibei.mapper.DistrictMapper;
import com.qj.daibei.pojo.District;
import com.qj.daibei.service.DistrictService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * author wml
 * Created on 2021/9/24 11:40
 */
@Service
public class DistrictServiceImpl implements DistrictService {

    @Autowired
    private DistrictMapper districtMapper;

    @Override
    public District queryDistrictByDisId(String district) {
        return null;
    }

    @Override
    public List<District> queryAllDistrict() {
        return this.districtMapper.selectList(null);
    }

    @Override
    public List<District> queryDistrictByCityId(String cityId) {
        QueryWrapper<District> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("city_id", cityId);
        return this.districtMapper.selectList(queryWrapper);
    }
}
